

#idString RIGOL TECHNOLOGIES,DP811A,
#name Rigol DP811A
#handle DP811A
#port 5555
#author maukka

; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value Voltage V D3 
#value Current A D3 
#value Power W D3
#value VoltageSet V D3 
#value CurrentSet A D3 

; How to poll for data, this is used for table and #values?
; a #askMode, #cmdMode and #prepareSample is used before this is string is used.
; This is a single line command
#askValues :MEASURE:VOLTAGE?;:MEASURE:CURRENT?;:MEASURE:POWER?;:VOLT?;CURRENT?

; Format of answer: f=float, u=remove trailing letters, x=skip
#askValuesReadFormat 

; Accept this delay when reading values (seconds)
;#readingDelay 2

; Mode change have a longer delay on reading values (seconds)
;#modeChangeDelay 10

; Switch meter to this mode during start, leave empty to avoid any switching
#initialMode 

; String to ask about actual meter mode, 
; This is a single line command
#askMode 

; When one of these commands are used through the command interface a new configuration will be done before using #askMode
; Only one word for each #mayModifyMode
; Specify command without initial colon and in the shortest possible form
;#mayModifyMode 



; Prepare the meter to response to #askValues
#prepareSample


; Initial commands to meter when establishing connection
#initCmd  


; Final command to meter before breaking connection
#finalCmd :SYSTEM:LOCAL
; :OUTP OFF;:VOLT 1;:CURRENT 0;

#outputOff :OUTP OFF


#interfaceType PS
#interface setVoltage :VOLT (value)
#interface setCurrent :CURRENT (value)
#interface setOn :OUTPUT (value)
#interface getVoltage :VOLT?
:readFormat: f
#interface getCurrent :CURRENT?
:readFormat: f
#interface getOn :OUTPUT:STAT?
#interface readVoltage 0
#interface readCurrent 1



; Strings to configure device in different modes
; First parameter must match a #value (4 parameter) and second parameter must match what #askMode returns
; First parameter is also used in shortcut menu
;#cmdMode 

; Setup menu functions
; The parameters on the first line is: type name page 
; Settings on the following lines are:
; read: SCPI to read value from device, is used to synchronize when opening setup page or setting equal named fields. Not always used
; readformat: Parse read value.
; write: Send the value to device, this field is used in combination with data fields in the details to send updates to device.
; tip: Add this tip to all components for this input field.

#cmdSetup radio Range Main 
:write: :OUTPUT:RANGE 
:read: :OUTPUT:RANGE?
:readFormat: 
:readmath: getElement("LOW HIGH",listIndex(value,"20V/10A 40V/5A"," ")," ")
:string: 
:update: Output
:updatedelayed: 0.3 
20V_10A LOW
40V_5A HIGH


#cmdSetup buttonsOn Output Main 
:read: :OUTPUT?
:write: :OUTPUT 
:readmath: getElement("OFF ON",listIndex(value,"OFF ON"," ")," ")
:string:
:tip: Turn output on or off
:updatealloff:
:update: Output
:updatedelayed: 0.3 
Off OFF
On ON


#cmdSetup radio Voltage Main 
:read: :VOLT?;
:readFormat: 
:write: :VOLT #
:tip: Setup this voltage
4.2V 4.2
5V 5.0
12V 12.0
24V 24.0


#cmdSetup radio Current Main 
:read: :CURRENT?
:readFormat: 
:write: :CURRENT
:tip: Output will current limit at this current
100mA 0.1
300mA 0.3
1A 1.0
3A 3.0
5A 5.0


#cmdSetup radio RemoteSense Main 
:read: :OUTPUT:SENSE?
:write: :OUTPUT:SENSE 
:readmath: getElement("OFF ON",listIndex(value,"OFF ON"," ")," ")
:string: 
:tip: Use sense wires to get exact voltage at target
Off OFF
On ON


#cmdSetup number Voltage Main 
:read: :VOLT?
:readformat: f
:write: :VOLT 
:tip: Setup this voltage, do not turn output on/off
Volt 0 40


#cmdSetup number Current Main 
:read: :CURRENT?
:readformat: f
:write: :CURRENT 
:tip: Setup this current, do not turn output on/off
Amps 0.0001 10


#cmdSetup number OVP Limits 
:read: :VOLT:PROT?
:readformat: f
:write: :VOLT:PROT #;:VOLT:PROT:STAT ON
:tip: Output will turn off if it is above this voltage
Volt 1 40

#cmdSetup radio OVP Limits 
:read: :VOLT:PROT:STAT?
:string: 
:write: :VOLT:PROT:STAT  
:tip: Turn over voltage protection (OVP) on or off
Off OFF
On ON

#cmdSetup number OCP Limits 
:read: :CURRENT:PROT?
:readformat: f
:write: :CURRENT:PROT #;:CURRENT:PROT:STAT ON
:tip: Output will turn off if it is above this current
Amps 0.01 10

#cmdSetup radio OCP Limits 
:read: :CURRENT:PROT:STAT?
:string: 
:write: :CURRENT:PROT:STAT  
:tip: Turn over current protection (OCP) on or off
Off OFF
On ON



#cmdSetup radio Display Display
:read: :DISPLAY?
:string:
:write: :DISPLAY 
:tip: Turn the front panel off and on
Off OFF
On ON


#cmdSetup radio Display_brightness Display
:read: :SYSTEM:BRIGHTNESS?
:write: :SYSTEM:BRIGHTNESS 
:tip: Adjust the front panel brightness
Min 1
25% 25
50% 50
Max 100


#cmdSetup radio Display_mode Display
:read: :DISPLAY:MODE?
:string:
:write: :DISPLAY:MODE 
:tip: Set the front panel display mode
Normal NORMAL
Waveform WAVE
Dials DIAL



